import request from '@/utils/request'
/**
 * 获取菜单分页列表
 * @param {*} menuSearchDto
 * @returns
 */
export function list() {
  return request({
    url: '/menu/list',
    method: 'post'
  })
}
/**
 * 获取菜单树形下拉数据
 * @param {*} menuType
 * @returns
 */
export function optionsTree(menuType) {
  return request({
    url: '/menu/optionsTree',
    method: 'get',
    params: {
      menuType
    }
  })
}
/**
 * 添加菜单
 * @param {*} sysMenu
 * @returns
 */
export function insertMenu(sysMenu) {
  return request({
    url: '/menu/insertMenu',
    method: 'post',
    data: sysMenu
  })
}

/**
 *  删除菜单
 * @param {*} menuId
 * @returns
 */
export function deleteByMenuId(menuId) {
  return request({
    url: `/menu/deleteByMenuId/${menuId}`,
    method: 'delete'
  })
}
